<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>fileUpload</title>
</head>
<body>
	<div class="easyui-panel" title="Upload File"
		style="width: 400px; padding: 30px 70px 50px 70px">
		<form class="easyui-form" id="fileUploadForm" method="POST"
			enctype="multipart/form-data">
			<div style="margin-bottom: 20px">
				<div>File:</div>
				<input class="easyui-filebox" name="file"
					data-options="prompt:'Choose another file...'" style="width: 100%">
			</div>
		</form>
		<div>
			<button class="easyui-linkbutton" style="width: 100%;"
				onClick="upload()">Upload</button>
		</div>
	</div>
	<div style="margin-bottom: 20px">
		<div>File:</div>
		<img id="img" alt="图片" src="">
	</div>

	<input type="file">

	<script type="text/javascript">
		function upload() {
			$('#fileUploadForm').form('submit', {
				url : '/upload',
				success : function(data) {
					var data = $.parseJSON(data);
					$('#img').attr('src', data.src);
				}
			})
		}
	</script>
</body>
</html>